/* 这是指针指向数组的范例
*/
#include <stdio.h>

int main(void)
{
	int a[5], i, *pa;
	pa = a;
	for(i=0; i<5; i++){
		*pa = i;
		pa++;
	}
	pa = a;
	for(i=0; i<5; i++){
		printf("a[%d]=%d\n",i, *pa);
		pa++;
	}

	printf("=========Below Is Array of pointers/a point to an array===\n");
	int c[5] = {1,2,3,4,5};
	int *p1[4];
	int (*p2)[4];
	printf("sizeof(int)=%d\n", sizeof(int));
	printf("sizeof(c)=%d\n", sizeof(c));
	printf("sizeof(p2)=%d\n", sizeof(p2));
	
	p2=&c;
	printf("(*p2)[0]=%d\n", (*p2)[0]);
	printf("(*p2)[1]=%d\n", (*p2)[1]);
	
	return 0;
}
